<?php
declare (strict_types=1);

namespace hiduoke\controller;

use hiduoke\traits\Backend;
use think\App;


/**
 * 控制器基础类
 */
abstract class AdminController extends BaseController
{
    protected $visit_type = 'admin';

    /**
     * 引入traits
     * traits内实现了CRUD等方法
     */
    use Backend;

    /**
     * 构造方法
     * @access public
     * @param App $app 应用对象
     */
    public function __construct(App $app)
    {
        parent::__construct($app);
    }

    public function url($controller, $action = 'index', $vars = [])
    {
        return $this->adminUrl($controller, $action, $vars);
    }

    public function getDkSys()
    {
        $dkSys = parent::getDkSys();
        $dkSys['project_type'] = 'framework';
        return $dkSys;
    }
}
